/**
  * @description: 订单详情中订单编号和时间模块
  * @author: yingying.fan
  * @date: 2019/3/8 16:43
  */
import React, { Component } from 'react'
import {
  StyleSheet,
  SafeAreaView,
  View, Text
} from 'react-native'
import { px2dp } from 'rn-xiaobu-utils'

type Props = {
  orderInfo: Object
}
export default class TimeInfo extends Component<Props> {

  constructor (props) {
    super(props)
    this.state = {}
  }

  _getInfoLine (key, value) {
    return (
      <View style={styles.timeInfoLine}>
        <Text style={styles.timeInfoKey}>{key}：</Text>
        <Text style={styles.timeInfoValue}>{value}</Text>
      </View>
    )
  }

  render () {
    return (
      <View style={styles.wrapper}>
        <Text style={styles.timeInfoLine}>订单编号：{this.props.orderInfo.ORDER_ID}</Text>
        <Text style={styles.timeInfoLine}>创建时间：{this.props.orderInfo.CREATE_TIME}</Text>
        <Text style={styles.timeInfoLine}>支付时间：{this.props.orderInfo.PAYMENT_TIME}</Text>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  wrapper: {
    backgroundColor: '#ffffff',
    paddingHorizontal: px2dp(30),
    paddingVertical: px2dp(25),
    marginTop: px2dp(16)
  },
  timeInfoLine: {
    color: '#666666',
    fontSize: px2dp(24),
    paddingVertical: px2dp(5)
  }
})